package com.zoke.daycarpool.view;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.zoke.daycarpool.R;
import com.zoke.support.base.BaseObjectListAdapter;
import com.zoke.support.floatingmenu.FloatingItem;
import com.zoke.support.utils.ViewHolder;

public class PullMenuAdapter extends BaseObjectListAdapter {

	public PullMenuAdapter(Context context, List<? extends Object> datas) {
		super(context, datas);
	}

	@Override
	public View getItemView(int position, View convertView, ViewGroup parent) {
		convertView = getConvertView(convertView,
				R.layout.listview_pullmenu_item);
		RelativeLayout mItemContainer = ViewHolder.get(convertView,
				R.id.item_pullmenu);
		TextView mItemText = ViewHolder.get(convertView, R.id.item_pullmenu_tv);
		FloatingItem item = (FloatingItem) mDatas.get(position);
		if (item.isSelected()) {
			mItemContainer
					.setBackgroundResource(R.drawable.floating_item_selected);
			mItemText.setTextColor(mContext.getResources().getColor(
					R.color._main));
		} else {
			mItemContainer.setBackgroundResource(R.drawable.common_translate);
			mItemText.setTextColor(mContext.getResources().getColor(
					R.color.white));
		}
		return convertView;
	}

}
